<?php
/* SVN FILE: $Id: app_model.php 7945 2008-12-19 02:16:01Z gwoo $ */

/**
 * Application model for Cake.
 *
 * This file is application-wide model file. You can put all
 * application-wide model-related methods here.
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) :  Rapid Development Framework (http://www.cakephp.org)
 * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright     Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 * @link          http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.app
 * @since         CakePHP(tm) v 0.2.9
 * @version       $Revision: 7945 $
 * @modifiedby    $LastChangedBy: gwoo $
 * @lastmodified  $Date: 2008-12-18 18:16:01 -0800 (Thu, 18 Dec 2008) $
 * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
 */

/**
 * Application model for Cake.
 *
 * Add your application-wide methods in the class below, your models
 * will inherit them.
 *
 * @package       cake
 * @subpackage    cake.app
 */
class AppModel extends Model {
	var $meses = array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
	function bubblesort($a){
		$array_size = count($a);
		$tmp="";
		for($x = 0; $x < $array_size; $x++):
			for($y = 0; $y < $array_size; $y++):
				if($a[$x] < $a[$y]):
					$hold = $a[$x];
					$a[$x] = $ran[$y];
				  	$ran[$y] = $hold;
				endif;
		  	endfor;
		endfor;
	}
	/*
	function cleanString($cadena){
		$patterns[0] = '/[á|â|à|å|ä]/';
		$patterns[1] = '/[ð|é|ê|è|ë]/';
		$patterns[2] = '/[í|î|ì|ï]/';
		$patterns[3] = '/[ó|ô|ò|ø|õ|ö]/';
		$patterns[4] = '/[ú|û|ù|ü]/';
		$patterns[5] = '/æ/';
		$patterns[6] = '/ç/';
		$patterns[7] = '/ß/';
		$patterns[8] = '/ñ/';
		$patterns[9] = "/'/";
		$patterns[10] = "/ /";
		$replacements[0] = 'a';
		$replacements[1] = 'e';
		$replacements[2] = 'i';
		$replacements[3] = 'o';
		$replacements[4] = 'u';
		$replacements[5] = 'ae';
		$replacements[6] = 'c';
		$replacements[7] = 'ss';
		$replacements[8] = 'n';
		$replacements[9] = '_';
		$replacements[10] = '_';
		
		return utf8_encode(preg_replace($patterns, $replacements, trim($cadena)));
	}
	*/
	function getMesById($id){
		/*
		 * $meses[0]="Enero";
		$meses[1]="Febrero";
		$meses[2]="Marzo";
		$meses[3]="Abril";
		$meses[4]="Mayo";
		$meses[5]="Junio";
		$meses[6]="Julio";
		$meses[7]="Agosto";
		$meses[8]="Septiembre";
		$meses[9]="Octubre";
		$meses[10]="Noviembre";
		$meses[11]="Diciembre";
		 */
		return $this->meses[$id];
	}
}
?>
